<span class="glyphicon glyphicon-map-marker" aria-hidden="true">
    <span>系统</span> /
    <span>banner轮滚</span> /
    <span>banner轮滚图片列表</span>
</span>
<div style="width: 100%;margin-top: 20px;">

    <div class="table-responsive" style="border:0px solid #fff;">
        <table class="table"  border="1" width="100%" cellpadding="0" cellspacing="0" style="margin: 20px 0px;">
            <tr>
                <td width="4%"  style="vertical-align: middle;">
                    <input type="checkbox" id="ids" onclick="getCheckbox()" />
                </td>
                <td width="5%" style="vertical-align: middle;">ID</td>
                <td width="20%" style="vertical-align: middle;">banner名称</td>
                <td width="20%" style="vertical-align: middle;">banner轮滚图片</td>
                <td width="20%" style="vertical-align: middle;">更新时间</td>
                <td width="15%" style="vertical-align: middle;">排序顺序</td>
                <td  style="vertical-align: middle;">操作</td>
            </tr>
            {volist name="list" id="vo"}
            <tr>
                <td style="vertical-align: middle;">
                    <input type="checkbox" name="ids[]" onclick="getCheckboxByIds({$vo.id})" id="ids-{$vo.id}" value="{$vo.id}" />
                </td>
                <td style="vertical-align: middle;">
                    {$vo.id}
                </td>
                <td style="vertical-align: middle;">
                    {$vo.name}
                </td>
                <td style="vertical-align: middle;">
                    {if condition="$vo.UploadLogo"}
                    <img src="__IMG__{$vo.UploadLogo.path}" style="max-width: 200px;max-height: 40px;"
                         data-target="#modal" data-toggle="modal" onclick="getPicture('{$vo.logo}')" />
                    {/if}
                </td>
                <td style="vertical-align: middle;">{$vo.update_time}</td>
                <td style="vertical-align: middle;">
                    <input type="number" step="1" min="0" value="{$vo.sort}" id="sort-{$vo.id}" name="sort-{$vo.id}"
                           class="form-control" onblur="getSort({$vo.id})"  />
                </td>
                <td style="vertical-align: middle;">
                    <a href="{:url('Admin/Banner/add',array('id' => $vo.id))}" class="ncap-btn-big ncap-btn-green"
                       style="background-color: #00a0e9;">编辑</a>
                </td>
            </tr>
            {/volist}
        </table>
    </div>
</div>
<script src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
<script src="__JS__/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript">
    function getSort(id) {
        var sort = $("input[id='sort-"+id+"']").val();
        var json = {id:id,sort:sort};
        $.ajax({
            type:"post",
            url:"{:url('Admin/Banner/Sort')}",
            data:json,
            success:function (res) {
                if(res != "排序成功"){
                    layer.msg(res);
                }
                if(res == "请重新登录"){
                    setTimeout("location_href()",1500);
                }
            }
        });
    }
</script>